const { values } = require('lodash')

function compose(f, g) {
  return function (value) {
    return f(g(value))
  }
}
// 反转后的第一位
const { log } = console
const compose = (f, g) => (value) => f(g(value))
const reverse = (arr) => arr.reverse()
const first = (arr) => arr[0]
// 先执行的在最内层所以放在最右面!
const last = compose(first, reverse) //6
log(last([1, 2, 3, 4, 5, 6]))
